<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <title>webrx</title>
    <script src="https://unpkg.com/axios"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
    <style>
        .container {
            padding: 15px;
        }

        .container > button {
            margin: 10px;
        }
    </style>

</head>
<body>
<div class="container">
    <button type="button" class="btn btn-primary">axios delete</button>
    <button type="button" class="btn btn-secondary">post(config delete)</button>
</div>
<script>
    let btns = document.querySelectorAll('button')
    btns[0].onclick = function () {
        axios.delete('http://localhost/del.php?id=66', {params: {name: '周丽'}, headers: {auth: '111111'}}).then(res => {
            let o = res.data
            console.log(o.code)
            console.log(o.msg)
            console.log(o.token)
            console.log(o.data.id)
            console.log(o.data.name)
        }).catch(err => console.log(err))

    }

    btns[1].onclick = function () {
        axios({
            method: 'DELETE',
            url: 'http://localhost/del.php',
            params: {id: 100, name: '周三'},
            headers: {auth: '111111111'}
        }).then(res => {
            let o = res.data
            console.log(o.code)
            console.log(o.msg)
            console.log(o.token)
            console.log(o.data.id)
            console.log(o.data.name)
        }).catch(err => console.log(err))

    }

</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
